<div id='email-tool' class="tool">
  <div class="tool-container">
    <div class="tool-heading">
      <h2 class="tool-title">Take action</h2>
      <% if params.include?('non_us_option') and params['non_us_option'] == "petition" %>
        <h3 id="non-us-option">Not in the U.S.?</h3>
      <% end %>
    </div>

    <div class="tool-body" id="target-email">
      <p>Send this email:</p>

      <fieldset disabled>
        <textarea class="form-control" rows="14"><%= @email_campaign.message %></textarea>
      </fieldset>
      <%= form_tag '/tools/email', method: 'post', target: '_blank' do |f| -%>
        <input type="hidden" name="action_id" value="<%= @actionPage.id %>" />
        <input type="hidden" name="dnt" value="false" />

        <%= render "/tools/newsletter_signup", email: true, location: true, privacy_notice: true %>

        <%= button_tag type: 'submit',
                       name: 'service',
                       value: 'default',
                       class: 'btn btn-red email-action' do -%>
          Open using default mail client
        <% end %>
        <p class="small">Or send using:</p>

        <%= button_tag type: 'submit',
                       name: 'service',
                       value: 'gmail',
                       class: 'btn btn-sm btn-red-outline email-action' do -%>
          <i class="icon-google"></i> Gmail
        <% end %>

        <%= button_tag type: 'submit',
                       name: 'service',
                       value: 'hotmail',
                       class: 'btn btn-sm btn-red-outline email-action' do -%>
          <i class="icon-windows"></i> Outlook
        <% end %>
        <br>

        <%= button_tag type: 'submit',
                       name: 'service',
                       value: 'copy',
                       data: {
                         :'clipboard-target' => 'email_target_text',
                         :placement => 'bottom',
                         :toggle => 'tooltip',
                         :title => 'Copied!',
                         :trigger => 'click',
                       },
                       id: 'copy-email-action',
                       class: 'btn btn-sm btn-red-outline email-action' do -%>
          <i class="icon-copy"></i> Copy to Clipboard
        <% end %>

        <div id='email_target_text'><%= render 'tools/email_target_text' %></div>

        <div class="thank-you" style="display: none;">
          <div class="alert alert-success">Thank you for the email</div>
        </div>

        <div class="email-tool-success-share" style="display: none;">
          <%= render 'tools/share' -%>
        </div>
      <% end %>
    </div>
  </div>
</div>

<div class="update-user-data-container" style="display: none;">
  <% if current_user %>
  <div class="checkbox small">
      <label for="update_user_data">    <input checked="checked" id="update_user_data" name="update_user_data" type="checkbox" value="yes">    Save my name and address for next time.</label>
  </div>
  <% end %>
</div>
